package com.yl.wanandroid_mvvm_kotlin_jetpack

import androidx.lifecycle.lifecycleScope
import com.alibaba.android.arouter.launcher.ARouter
import com.yl.common.base.BaseActivity
import com.yl.common.exp.Constants
import com.yl.wanandroid_mvvm_kotlin_jetpack.databinding.ActivitySplashBinding
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch

class SplashActivity : BaseActivity<ActivitySplashBinding>() {

    override fun getLayoutID(): Int = R.layout.activity_splash

    override fun init() {
        mBind.context = this
    }

    override fun initData() {
        lifecycleScope.launch {
            delay(1000)
//            startActivity<LoginActivity>()
            ARouter.getInstance().build(Constants.LOGIN_ACTIVITY).navigation()
            finish()
        }
    }
}